package com.example.jw_web.Mapper;

import com.example.jw_web.pojo.MessageBoard;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@Mapper
public interface MessageBoardDao {

    //查询所有的留言信息
    @Select("select * from  message_border ")
    List<MessageBoard> getMessages();

    @Insert("insert into message_border(username, messageText, fontName, fontColor) VALUES (#{username},#{messageText},#{fontName},#{fontColor})")
    void saveMessages(MessageBoard messageBoard);
}
